home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-11 | 2.0 KB | 64 lines | [TEXT/GEOL] |
- Item 9295388 9-May-90 10:33PDT
-
- From: D4684 Robins Analytics, S Robins,PRT
-
- To: STRONG.S Strong, Steve
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Solution: Tabbing between…
-
- Steve,
- I have solved the tabbing between fields bug in Dialog views. This is
- probably old news but I've included it any how since I am probably not the only
- person in the world who never got around to fixing it.
- The problem was that in my dialogs I have fields that have different
- maximum number of characters. When you try to tab from a field that has 2
- characters max to one that has 3 characters it would fail if the 3 char field
- was full because the fMaxChars field isn't set yet before the SetText. The
- number of characters it is trying to set is greater that what it thinks is its
- max. The solution was simple. I just set the variable before calling SetText in
- TDialogTEView.InstallEditText. It works fine now.
-
- IN TTEView.StuffText:
- It would fail here since fMaxChars is still set to the last fields value not
- the one we are tabbing to.
-
- IF textLength > fMaxChars THEN
- BEGIN
- {$IFC qDebug}
- ProgramBreak('Text size exceeds maximum for this view');
- {$ENDC}
- Failure(minErr, 0); { ??? Assign a message }
- END;
-
- The solution in TDialogTEView.InstallEditText:
- BEFORE:
- theEditText.GetText(theText);
- SetText(theText);
- RecalcText;
- IF selectChars THEN
- SetSelect(0, MAXINT, fHTE)
- ELSE
- SetSelect(0, 0, fHTE); { Caller will set the selection. }
- fMaxChars := theEditText.fMaxChars;
-
- AFTER:
- fMaxChars := theEditText.fMaxChars;
- theEditText.GetText(theText);
- SetText(theText);
- RecalcText;
- IF selectChars THEN
- SetSelect(0, MAXINT, fHTE)
- ELSE
- SetSelect(0, 0, fHTE); { Caller will set the selection. }
-
- Once again, I would like to declare my love for THINK 3.0. Lightsbug is
- AWESOME. It makes things like this so easy to find.
-
- Good Luck,
- Doug Ahmann
- Robins Analytics
- St. Paul, MN
-
-